* term/x-win.el (scroll-bar-mode, scroll-bar-mode): Move these
authorJim Blandy <jimb@redhat.com>
Thu, 25 Feb 1993 00:38:55 +0000 (00:38 +0000)
committerJim Blandy <jimb@redhat.com>
Thu, 25 Feb 1993 00:38:55 +0000 (00:38 +0000)
functions to scrolbar.el.
* scrollbar.el (scroll-bar-mode, scroll-bar-mode): Here they are.
Make scroll-bar-mode set the {vertical,horizontal}-scrollbars
parameters in default-frame-alist, and modify all extant screens
using the correct parameter names.

lisp/scroll-bar.el
lisp/term/x-win.el

index e0d38e3d30c7a33d455544426878a8490b5c352a..63b37a59145f39a1c07cc95af1f18ee6866e771f 100644 (file)
@@ -39,6 +39,36 @@ that scrollbar position."
   (truncate (/ (* (float (car num-denom)) whole) (cdr num-denom))))
 
 \f
+;;;; Helpful functions for enabling and disabling scroll bars.
+(defvar scroll-bar-mode nil)
+
+(defun scroll-bar-mode (flag)
+  "Toggle display of vertical scroll bars on each frame.
+This command applies to all frames that exist and frames to be
+created in the future.
+With a numeric argument, if the argument is negative,
+turn off scroll bars; otherwise, turn on scroll bars."
+  (interactive "P")
+  (setq scroll-bar-mode (if (null flag) (not scroll-bar-mode)
+                         (or (not (numberp flag)) (>= flag 0))))
+  (mapcar
+   (function
+    (lambda (param-name)
+      (let ((parameter (assq param-name default-frame-alist)))
+       (if (consp parameter)
+           (setcdr parameter scroll-bar-mode)
+         (setq default-frame-alist
+               (cons (cons param-name scroll-bar-mode)
+                     default-frame-alist))))))
+   '(vertical-scrollbars horizontal-scrollbars))
+  (let ((frames (frame-list)))
+    (while frames
+      (modify-frame-parameters
+       (car frames)
+       (list (cons 'vertical-scrollbars scroll-bar-mode)
+            (cons 'horizontal-scrollbars scroll-bar-mode)))
+      (setq frames (cdr frames)))))
+\f
 ;;;; Buffer navigation using the scrollbar.
 
 (defun scrollbar-set-window-start (event)
index e918a68f7e15bd5aed22182311a2046746ccbfe6..0c9210a410db52c6a2426777bf74d35ba72aa035 100644 (file)
@@ -415,25 +415,6 @@ This returns ARGS with the arguments that have been processed removed."
           (setq defined-colors (cons this-color defined-colors))))
     defined-colors))
 \f
-(defvar scroll-bar-mode nil)
-
-;;; ??? x-create-screen needs to be changed to use scroll-bar-mode
-;;; to decide (by default) whether to make a scroll bar.
-(defun scroll-bar-mode (flag)
-  "Toggle display of vertical scroll bars on each frame.
-This command applies to all frames that exist and frames to be
-created in the future.
-With a numeric argument, if the argument is negative,
-turn off scroll bars; otherwise, turn on scroll bars."
-  (interactive "P")
-  (setq scroll-bar-mode (if (null flag) (not scroll-bar-mode)
-                         (or (not (numberp flag)) (>= flag 0))))
-  (let ((frames (frame-list)))
-    (while frames
-      (modify-frame-parameters (car frames)
-                              (list (cons 'vertical-scrollbar scroll-bar-mode)))
-      (setq frames (cdr frames)))))
-\f
 ;;;; Function keys
 
 ;;; Give some common function keys reasonable definitions.